﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Audio;
using System.Collections.Generic;

namespace GameEngine
{
    namespace ContentLoader
    {
        public abstract class Loader<ContentType>
        {
            public Loader()
            {
                Content = new ContentManager(Game1.Game.Services);
                Content.RootDirectory = "Content";
            }
            public ContentManager Content;
            public Dictionary<string, Texture2D> Textures = new Dictionary<string, Texture2D>();

            public virtual ContentType Load(string filename)
            {
                return Content.Load<ContentType>(filename);
            }
        }

        public class TextureLoader : Loader<Texture2D>
        {
            public TextureLoader()
                : base()
            {
                Content.RootDirectory += "\\Textures";
            }

        }

        public class FontLoader : Loader<SpriteFont>
        {
            public FontLoader()
                : base()
            {
                Content.RootDirectory += "\\Fonts";
            }

        }






    }
}